package com.yogurt.cms.controller;


import com.yogurt.cms.entity.CrmBanner;
import com.yogurt.cms.service.CrmBannerService;
import com.yogurt.utils.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author yogurt
 * @since 2020-12-13
 */
@RestController
@RequestMapping("/educms/banner")
@CrossOrigin
public class BannerFrontController {

    @Autowired
    private CrmBannerService bannerService;

    @ApiOperation("查询首页所有banner")
    @GetMapping("/getAllBanner")
    public Result getAllBanner(){
        List<CrmBanner> list = bannerService.getAllBanner();
        return Result.ok().data("list",list);
    }

}

